Skip to content

Fix Symfony Console deprecation: Replace add() with addCommand()#150

Merged
techmahedy merged 1 commit intodoppar:3.xfrom
xentixar:fix/symfony-console-deprecation
Nov 27, 2025
Merged

Fix Symfony Console deprecation: Replace add() with addCommand()#150
techmahedy merged 1 commit intodoppar:3.xfrom
xentixar:fix/symfony-console-deprecation

Conversation

@xentixar
Copy link
Member

Description

This PR fixes a deprecation warning from Symfony Console 7.4+.

Changes

  • Replaced the deprecated add() method with addCommand() in the Console class
  • This ensures compatibility with Symfony Console 8.0

Deprecation Warning Fixed

⛔ ERROR: Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated and will be removed in Symfony 8.0, use "Symfony\Component\Console\Application::addCommand()" instead.

Testing

  • Code compiles without deprecation warnings
  • Backward compatible (both methods work the same way)

References

Since symfony/console 7.4, the add() method is deprecated and will be removed in Symfony 8.0.
This commit updates the Console class to use the recommended addCommand() method instead.

Fixes deprecation warning:
⛔ ERROR: Since symfony/console 7.4: The "Symfony\Component\Console\Application::add()" method is deprecated and will be removed in Symfony 8.0, use "Symfony\Component\Console\Application::addCommand()" instead.
@techmahedy techmahedy merged commit 4263cf6 into doppar:3.x Nov 27, 2025
5 of 11 checks passed
@rrr63
Copy link
Member

rrr63 commented Nov 27, 2025

Thanks @xentixar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants